import { Frame } from '@/frame';

export default class UICommonTip {
    static root: Frame;
    static background: Frame;
    constructor() {
        this._init_ui();
    }
    private _init_ui() {
        UICommonTip.background = new Frame('BACKDROP', null, null, '_sl_border_backdrop', 0);
        UICommonTip.root = Frame.createTEXT();
        UICommonTip.root.setAbsPoint(FRAMEPOINT_BOTTOMRIGHT, 0.79, 0.17).setSize(0.2, 0).setFont(0.01113, 'fonts\\fonts.ttf');
        UICommonTip.background.setPoints(UICommonTip.root.current, 0.007, 0.007);
        UICommonTip.root.setVisible(false);
        UICommonTip.background.setVisible(false);
    }
    show(text: string) {
        UICommonTip.root.setText(text);
        UICommonTip.root.visible = true;
        UICommonTip.background.visible = true;
    }
    hide() {
        UICommonTip.root.visible = false;
        UICommonTip.background.visible = false;
    }
}
